import java.util.Scanner;

public class Main3{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int c = in.nextInt();
        IntegerDigitSum ids = new IntegerDigitSum();
        int result = ids.getDigitSum(c);
        System.out.printf("%d\n", result);
    }
}

/* 请在这里填写答案 */
class IntegerDigitSum {
    public int getDigitSum(int c){
        c = Math.abs(c);
        int result = 0;
        while(c>0){
            result += c%10;
            c = c/10;
        }
        return result;
    }
}